<template>
	<view class="home">
		<search></search>
		<img-card :list="imgList" class="img"></img-card>
	</view>
</template>

<script>
	import TabBar from '@/components/tabBar.vue'
	import Search from '@/components/search.vue'
	import ImgCard from './components/img-card.vue'
	import {getHomeInfo} from '@/common/api/index.js'
	export default {
		components: { TabBar, Search, ImgCard },
		data() {
			return {
				size: 10,
				current: 1,
				imgList: []
			}
		},
		mounted() {
			this.getInfo()
		},
		methods: {
			async getInfo () {
				let res = await getHomeInfo(this.current,this.size)
				console.log(res,'首页')
				if (res.code === 0) {
					this.imgList = res.data.records
				}
			}
		}
	}
</script>

<style lang="less" scoped>
.home {
	width: 100%;
	height: 100%;
	padding-bottom: 168upx;
	padding-top: 208upx;
	box-sizing: border-box;
	.img {
		width: 100%;
		//height: calc(100% - 376upx);
		height: 100%;
	}
}
</style>
